import java.util.Scanner;

/*
    分类计数
 */
public class ClassificationCount {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        char s[] = str.toCharArray();
        sc.close();
        int num=0,Bz=0,Sz=0;
        for (char c:s){
            if (Character.isUpperCase(c)){
                ++Bz;
            } else if(Character.isLowerCase(c)) {
                ++Sz;
            } else if(Character.isDigit(c)) {
                ++num;
            }
        }
        System.out.println(Bz);
        System.out.println(Sz);
        System.out.println(num);
    }
}
